//
//  UIColor+Helper.swift
//  SwiftWeibo
//
//  Created by 苏强 on 16/11/17.
//  Copyright © 2016年 suqianghotel. All rights reserved.
//


import UIKit

extension UIColor{
    static var random:UIColor {
        
        return UIColor(red: CGFloat(arc4random_uniform(256)) / CGFloat(255),
                       green: CGFloat(arc4random_uniform(256)) / CGFloat(255),
                       blue: CGFloat(arc4random_uniform(256)) / CGFloat(255),
                       alpha: 1)
    }
    
    
    
    convenience init(hex:Int) {
        
        let red = hex & 0xFF0000 >> 16
        let green = hex & 0xFF00 >> 8
        let blue = hex & 0xFF
        
        self.init(red: CGFloat(red) / CGFloat(255), green: CGFloat(green) / CGFloat(255), blue: CGFloat(blue) / CGFloat(255), alpha: 1.0)
        
    }
}
